GSOAP_ROOT = $(PWD) 
CC = $(CROSS_COMPILE)gcc -g -DWITH_NONAMESPACES  -DSOAP_DEBUG -DDEBUG
INCLUDE = -I$(GSOAP_ROOT)
SERVER_OBJS =  soapC.o stdsoap2.o soapClient.o onvif_server_interface.o soapServer.o duration.o onvif_server.o onvif_function.o main.o

AR = $(CROSS_COMPILE)ar
LIB = libst_onvif.a
OBJS =  soapC.o stdsoap2.o soapClient.o onvif_server_interface.o soapServer.o duration.o onvif_server.o onvif_function.o
AR_OPTS=-rc

all: server lib
server: $(SERVER_OBJS)
	$(CC) $(INCLUDE) -o deviceserver  $(SERVER_OBJS) -lpthread
 
lib : $(OBJS)
	@echo \# Creating archive $(LIB)
	$(AR) $(AR_OPTS) $(LIB) $(OBJS)
install:
	cp $(LIB) $(prefix)/lib/ -rf
	cp onvif_server.h $(prefix)/include/ -rf
clean: 
	rm -f *.o deviceprobe  deviceserver onvif $(LIB)
